<template>
  <div>
    <!-- 用户认证弹框 -->
    <Modal
      :closable="false"
      :mask-closable="false"
      class="Modalcss"
      v-model="userAuthenticationModal"
      :title="userTitle"
      :styles="{ top: '200px' }"
    >
      <p>
        &nbsp; &nbsp; &nbsp;&nbsp; 您还未进行<span style="color: red">资料认证</span
        >，请前往认证页面进行认证，否则将您将无法正常使用发货功能等功能。
      </p>
      <div style="margin-top: 20px">
        <!-- <RadioGroup v-model="authenticationRadio">
          <Radio label="个人认证"></Radio>
          <Radio label="企业认证"></Radio>
        </RadioGroup> -->
      </div>
      <div slot="footer">
        <Button @click="userAuthenticationModal = false">取消</Button>
        <Button @click="authenticationChoice" class="but-left">去认证</Button>
      </div>
    </Modal>
  </div>
</template>

<script>
import {
  userInfoVo, //货主信息
} from "@/api/ownerEnd/waybillAdmin";
export default {
  props: {
    usernModal: {
      type: String,
      default: "",
    },
  },
  watch: {
    usernModal(val) {
      this.userAuthenticationModal = val; //用户认证
    
    },
    // visible(value) {
    //   this.$emit("input", value);
    // },
    // OwnerDetailsId(val) {
    //   if (val != "") {
    //     this.OwnerDetailsId = val;
    //     this.getDataList();
    //     this.receivedEvaluation();
    //   }
    // },
  },
  data() {
    return {
      userAuthenticationModal: this.usernModal, //用户认证
      authenticationRadio: "个人认证", //选择用户类型
      personals: true,
      enterprises: false,
      userTitle: "企业认证",
    };
  },
  created() {

  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      userInfoVo().then((res) => {
        if (res.result.companyInfoVo.companyType == 1) {
          this.userTitle = "个人认证";
        } else if (res.result.companyInfoVo.companyType == 2) {
          this.userTitle = "企业认证";
        }
      });
    },
    personalsbuts() {
      this.personals = true;
      this.authenticationRadio = "个人认证";
      this.enterprises = false;
    },
    enterprisesbuts() {
      this.enterprises = true;
      this.authenticationRadio = "企业认证";
      this.personals = false;
    },
    authenticationChoice() {
      this.userAuthenticationModal = false;
      this.authentication = true;
      this.userChoice = this.authenticationRadio;
      this.$router.push({
        name: "ownerManagement/personal-center/accountUmberAdmin",
        query: {
          authenticationRadio:"企业认证",
          authentication: 2,
        },
      });
    },
  },
};
</script>
<style lang="less">
.but-left {
  margin-left: -10px;
  background-color: #19be6b !important;
  color: #fff !important;
  border: 0 !important;
}
.Modalcss {
  .ivu-modal-header {
    border-bottom: 0px !important;
  }
  .ivu-modal-footer {
    border-top: 0px !important;
  }
  .ivu-modal-header-inner {
    font-size: 16px !important;
    font-weight: 600 !important;
  }
}
</style>